package com.tencreat.domain.mall.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tencreat.common.core.domain.BaseEntity;
import com.tencreat.common.enums.OrderStatus;
import com.tencreat.common.enums.PayType;
import com.tencreat.common.enums.ShopOrderStatus;
import com.tencreat.common.enums.UserOrderStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;


/**
 * 订单对象 mall_order
 *
 * @author tencreat
 * @date 2021-08-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@ExcelIgnoreUnannotated
public class MallOrderVO4 extends BaseEntity<MallOrderVO4> {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "优惠券ID")
    @TableField("`coupon_id`")
    private Long couponId;

    /**
     * 订单编号
     */
    @ExcelProperty(value = "订单编号",order = 1)
    @ApiModelProperty(value = "订单编号")
    private String orderSn;

    @ExcelProperty(value = "用户ID",order = 2)
    @ColumnWidth(9)
    @ApiModelProperty(value = "用户表的用户UUID")
    private Long uuid;

    @TableField(exist = false)
    @ExcelProperty(value = "手机号码",order = 3)
    private String userPhone;

    @ExcelProperty(value = "商品ID",order = 4)
    @ColumnWidth(9)
    private Long goodsId;

    @TableField(exist = false)
    @ExcelProperty(value = "商品名称",order = 5)
    private String goodsName;
    @ExcelProperty(value = "供应商名称",order = 5)
    @ApiModelProperty("供应商名称")
    @TableField(exist = false)
    private String username;
    @ExcelProperty(value = "一级分类",order = 5)
    @TableField(exist = false)
    private String oneLevel;
    @ExcelProperty(value = "二级分类",order = 5)
    @TableField(exist = false)
    private String twoLevel;
    @ApiModelProperty("商品规格")
    @ExcelProperty(value = "商品规格", order = 7)
    private String attribute;

    @ExcelProperty(value = "商品类型",order = 8)
    @ApiModelProperty(value = "订单类型")
    private String orderTypeDesc;

    @ExcelProperty(value = "数量",order = 9)
    @TableField(exist = false)
    private Integer goodsNum;
    @ExcelProperty(value = "货款",order = 9)
    @TableField(exist = false)
    private BigDecimal supplyPrice;


    @ExcelProperty(value = "优惠金额",order = 10)
    @ApiModelProperty(value = "会员减免")
    private BigDecimal memberPrice;

    @ExcelProperty(value = "抵扣金额",order = 10)
    @ApiModelProperty(value = "积分抵扣金额")
    private BigDecimal deductPrice;

    @ExcelProperty(value = "实付金额",order = 10)
    @ApiModelProperty(value = "实付费用， = goods_price - coupon_price + freight_price")
    private BigDecimal actualPrice;
    @ExcelProperty(value = "支付积分",order = 10)
    @ApiModelProperty(value = "用户积分减免")
    private BigDecimal integralPrice;

    @ExcelProperty(value = "订单备注",order = 12)
    @ApiModelProperty(value = "用户订单留言")
    private String message;

    @ExcelProperty(value = "付款方式",order = 13)
    @ApiModelProperty(value = "支付方式")
    private String payTypeDesc;

    @ExcelProperty(value = "订单状态",order = 14)
    @ApiModelProperty(value = "订单状态")
    private String orderStatusDesc;


    @ApiModelProperty("创建时间")
    @ExcelProperty(value = "下单时间",order = 15)
    @ColumnWidth(18)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime2;
}
